package com.tengju.data.infrastructure.persistence.mybatis.mapper.clickhouse.user;

import com.tengju.data.infrastructure.persistence.mybatis.dataobject.*;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface DwdUserDominationRelationMapAllMapper {

    List<DominationTeamCountDO> queryNewMember(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                               @Param("starLevelList") List<Integer> starLevelList, @Param("from") Date from, @Param("to") Date to);

    List<DominationTeamCountDO> queryNewMemberByIdCodes(@Param("idCodes") List<Long> idCodes, @Param("dominationLevel") Integer dominationLevel,
                                                        @Param("starLevelList") List<Integer> starLevelList, @Param("from") Date from, @Param("to") Date to);

    List<DominationIdCodeTeamCountDO> queryNewMemberByDominationIdCodes(@Param("idCodes") List<Long> idCodes,
                                                                        @Param("dominationLevel") Integer dominationLevel,
                                                                        @Param("starLevelList") List<Integer> starLevelList,
                                                                        @Param("visitDates") List<String> visitDates,
                                                                        @Param("from") Date from, @Param("to") Date to);

    List<UpgradingDetailDO> queryNewMemberDetail(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                                 @Param("starLevelList") List<Integer> starLevelList, @Param("from") Date from, @Param("to") Date to,
                                                 @Param("offset") int offset, @Param("limit") int limit);

    List<DominationTeamCountDO> dominationStarChangeRecordNumByBeforeStarLevel(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                                                               @Param("changeType") Integer changeType, @Param("starLevelList") List<Integer> starLevelList);

    List<DominationTeamCountDO> dominationStarChangeRecordNumByIdCodes(@Param("idCodes") List<Long> idCodes, @Param("dominationLevel") Integer dominationLevel,
                                                                       @Param("changeType") Integer changeType);

    List<StarChangeNoticeRecordDO> dominationStarChangeRecordDetailByBeforeStarLevel(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                                                                     @Param("changeType") Integer changeType, @Param("starLevelList") List<Integer> starLevelList,
                                                                                     @Param("offset") int offset, @Param("limit") int limit);

    List<DominationTeamCountDO> dominationStarChangeRecordNumByUpComingStarLevel(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                                                                 @Param("changeType") Integer changeType, @Param("targetStarLevelList") List<Integer> targetStarLevelList,
                                                                                 @Param("currentStarLevelList") List<Integer> currentStarLevelList);

    List<StarChangeNoticeRecordDO> dominationStarChangeRecordDetailByUpComingStarLevel(@Param("idCode") Long idCode, @Param("dominationLevel") Integer dominationLevel,
                                                                                       @Param("changeType") Integer changeType, @Param("targetStarLevelList") List<Integer> targetStarLevelList,
                                                                                       @Param("currentStarLevelList") List<Integer> currentStarLevelList, @Param("offset") int offset, @Param("limit") int limit);

    List<DominationTeamCountDO> dominationTeamSignCountByStepsNotAuditStats(@Param("idCodes") List<Long> idCodes, @Param("dominationLevel") Integer dominationLevel,
                                                                            @Param("steps") List<Integer> steps, @Param("auditStats") List<Integer> auditStats);


    List<DominationIdCodeTeamCountDO> queryDealerNewMemberByDominationIdCodes(@Param("idCodes") List<Long> idCodes,
                                                                              @Param("dominationLevel") Integer dominationLevel,
                                                                              @Param("starLevelList") List<Integer> starLevelList,
                                                                              @Param("visitDates") List<String> visitDates,
                                                                              @Param("from") Date from,
                                                                              @Param("to") Date to);

    Integer isDominationMember(@Param("idCode") Long idCode,
                               @Param("dominationIdCode") Long dominationIdCode,
                               @Param("dominationLevel") Integer dominationLevel);

    List<DwdUserDominationTeamRelationDO> queryUserDominationTeamRelation();

    List<DwdUserDominationTeamParentDO> queryUserDominationTeamParent();

    List<DwdUserDominationTeamParentDO> queryEecDominationTeamParent();

    List<DwdUserDominationTeamParentDO> queryUserDominationTeamParentByDominationIdCodeList(@Param("dominationIdCodeList") List<Long> dominationIdCodeList);

    List<DwdUserDominationTeamParentDO> queryEecDominationTeamParentByDominationIdCodeList(@Param("dominationIdCodeList") List<Long> dominationIdCodeList);

    List<DwdUserDominationTeamParentDO> queryUserDominationTeamParentByDominationIdCode(@Param("dominationIdCode") Long dominationIdCode);

}
